﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserManagement.aspx.cs"
    Inherits="CURE.SystemManagement.UserManagement" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
    function checkUsername() {
        var reg = /\s/g; //非空格
        //var reg_c = /^[\u4E00-\u9FA5]+$/; //仅限中文
        var username = document.getElementById("reg_username").value;
        username = username.replace(/(^\s*)|(\s*$)/g, ''); //去掉前后空格
        if (username != null && username != "") {
            if (reg.test(username)) {
                alertMsg.error('用户名称不能出现空格！');
                $('#reg_username').val('');
                return false;
            }
            var l = getByteLen(username);
            if (l > 20) {
                alertMsg.error('用户名称最多为20位字符！(中文相当于2个字符)');
                return false;
            }
        }
        return true;
    }
    function checkUserid() {
        var reg = /[\u4E00-\u9FA5]/i; //非中文
        //var reg = /[^\x00-\xff]/g;//非中文以及中文输入法下符号
        var userid = document.getElementById("reg_userid").value;
        userid = userid.replace(/(^\s*)|(\s*$)/g, ''); //去掉前后空格
        if (userid != null && userid != "") {
            if (reg.test(userid)) {
                alertMsg.error('用户编号不能出现中文！');
                $('#reg_userid').val('');
                return false;
            }
            if (userid.length > 30) {
                alertMsg.error('用户编号最多为30位数字！');
                return false;
            }
        }
        return true;
    }
//获取字符位数，中文占两位字符
    function getByteLen(val) {
        var len = 0;
        for (var i = 0; i < val.length; i++) {
            if (val[i].match(/[^\x00-\xff]/ig) != null) //全角
                len += 2;
            else
                len += 1;
        }
        return len;
    }


  

</script>
<title>无标题页</title>
</head>
<body>
    <form id="pagerForm" method="post" action="SystemManagement/UserManagement.aspx">
    <input type="hidden" name="numPerPage" value="<% =NumPerPage %>" />
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="id" value="<%=Id %>" />
    <input type="hidden" name="name" value="<%=Name %>" />
    </form>
    <div class="pageHeader">
        <form onsubmit="return navTabSearch(this);" action="" method="post">
        <div class="searchBar" style="margin-top: 13px; margin-bottom: 13px">
            <table class="searchContent">
                <tr>
                    <td>
                       <label> 员工编号：</label><input type="text" maxlength="30" onblur="checkUserid();" id="reg_userid"  name="id" value="<%=Id %>" />
                    </td>
                    <td>
                        <label>用户姓名：</label><input type="text" maxlength="20" onblur="checkUsername();" id="reg_username" name="name" value="<%=Name %>" />

                    </td>
                    <td>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button  type="submit" style="width: 50px; height: 30px">
                                    检索</button></div>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </div>
    <div class="pageContent"  style=" margin-top:-2px;">
        <div class="panelBar">
            <ul class="toolBar">
                <li><a class="add" width="520" height="280" rel="AddUser" href="SystemManagement/UserInformation.aspx?action=add"
                    target="dialog"><span>用户添加</span></a></li>
            </ul>
        </div>
        <div>
            <table class="table" width="100%" layouth="135">
                <thead>
                 <tr>
                 <th style="text-align: center;">员工编号</th>
                 <th style="text-align: center;">用户姓名</th>  
                 <th style="text-align: center;">登录密码</th>
                 <th style="text-align: center;">用户性别</th>
                 <th style="text-align: center;">所属部门</th>
                 <th style="text-align: center;">电子邮箱</th>
                 <th style="text-align: center;">是否发送邮件</th>
                 <th style="text-align: center;">电话</th>
                 <th style="text-align: center;">用户角色</th>
                 <th style="text-align: center;">职务</th>
                <%-- <th style="text-align: center;">技能等级</th>
                 <th style="text-align: center;">岗位技能(运输)</th>
                 <th style="text-align: center;">岗位技能(包装)</th>
                 <th style="text-align: center;">岗位技能(发货)</th>--%>
                 <th style="text-align: center;">执行操作</th>
                 <th style="text-align: center;">重置密码</th>
                 </tr>
                </thead>
                <tbody>
                 <asp:Repeater runat="server" ID="reptMaster" >
                    <ItemTemplate>
                    <tr>
                        <td style="text-align: center;">
                            <%#Eval("USERID")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("NAME")%>
                        </td>
                        <td style="text-align: center;">
                            ******
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("SEX")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("DEPT")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("EMAIL")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("ISEMAIL")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("TEL")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("GROUP_NAME")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("JOB")%>
                        </td>
 <%--                       <td style="text-align: center;">
                            <%#Eval("SKILLLEVEL")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("SKILL_TRANSPORT")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("SKILL_PACKAGING")%>
                        </td>
                        <td style="text-align: center;">
                            <%#Eval("SKILL_SHIPMENTS")%>
                        </td>--%>
                        <td style="text-align: center;">
                            <a title="编辑" target="dialog" rel="EditUserInfo" width="520" height="280" href="SystemManagement/UserInformation.aspx?action=edit&editid=<%#Eval("ID")%>"
                                class="btnEdit">编辑</a> 
                                <a target="ajaxTodo" href="Handler/UserHandler.ashx?action=delete&deleteid=<%# DataBinder.Eval(Container.DataItem, "id")%>" title="确定要删除吗?" class="btnDel">
                               
                        </td>
                       <td>
                        <a title="确定要重置密码吗？" target="ajaxTodo" href="Handler/UserHandler.ashx?action=restore&restoreid=<%# DataBinder.Eval(Container.DataItem, "id")%>" class="btnEdit">重置密码</a>
                       </td>
                    </tr>
                    </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
        </div>
       <div class="panelBar">
            <div class="pages">
                <span>显示</span>
                <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                    <option value="<%=NumPerPage %>">选择</option>
                    <option value="20">20</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                    <option value="200">200</option>
                </select>
                <span>条，共<%=TotalCount%>条</span>
            </div>
            <div class="pagination" targettype="navTab" totalcount="<%=TotalCount%>" numperpage="<%=NumPerPage %>" pagenumshown="<%=PageNumShown %>"
                currentpage="<%=PageNum %>">
            </div>
        </div>
    </div>
</body>
</html>
